import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  base: '/SsNw/',
  plugins: [
    vue(),
  ],
  resolve: {
    alias: {
      'src': fileURLToPath(new URL('./src', import.meta.url)),
      'api': fileURLToPath(new URL('./src/api', import.meta.url)),
      'base': fileURLToPath(new URL('./src/base', import.meta.url)),
      'common': fileURLToPath(new URL('./src/common', import.meta.url)),
      'components': fileURLToPath(new URL('./src/components', import.meta.url))
    },
    extensions: ['.js', '.vue', '.json', '.scss']
  },
  server: {
    host: '0.0.0.0',
    port: 5174,
    proxy: {
      // '/webDataApi': {
      //   target: 'http://localhost:3000',
      //   changeOrigin: true
      // }
    }
  }
})
